from log.chaojiying import get_code_base64,get_monny

import requests

while True:
    res = requests.get('https://www.labnetwork.com.cn/gateway/basic/mall/oauth/code?0.1231387301383613')
    base64_str = res.json()['data']['img'][22:]
    uuid = res.json()['data']['uuid']


    cade = get_code_base64(base64_str,1902)
    print(cade)


    res_login = requests.post('https://www.labnetwork.com.cn/gateway/basic/mall/oauth/login',json={
        "userEmail": "1375395139@qq.com",
        "password": "Zzzf0904",
        "captchaCode": cade['pic_str'],
        "captchaKey": uuid
    })

    if res_login.json()['status'] == 190004:
        print('验证码错误')
        get_monny(cade['pic_id'])
    else:
        print(res_login.json())
        break